import 'package:flutter/material.dart';

class MyApp13 extends StatelessWidget {
  const MyApp13({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //导航条
        appBar: AppBar(
          title: const Text('ListView组件',
              style: TextStyle(
                  fontSize: 20,
                  fontWeight: FontWeight.bold,
                  color: Colors.white)),
          backgroundColor: Colors.pink,
          centerTitle: true,
        ),
        //主体区域
        body: ListView(
          //滚动方向
          // scrollDirection: Axis.horizontal,
          //禁止滚动
          //physics: const NeverScrollableScrollPhysics(),
          //滚动方向是否为反方向
          //  reverse: true,
          children: [
            Container(
              height: 100,
              color: Colors.red,
              child: const Text('我是容器111'),
            ),
            Container(
              height: 150,
              color: Colors.blue,
              child: const Text('我是容器222'),
            ),
            Container(
              height: 200,
              color: Colors.green,
              child: const Text('我是容器333'),
            ),
            Container(
              height: 250,
              color: Colors.yellow,
              child: const Text('我是容器4'),
            ),
            Container(
              height: 300,
              color: Colors.orange,
              child: const Text('我是容器5'),
            ),
            Container(
              height: 350,
              color: Colors.pink,
              child: const Text('我是容器6'),
            ),
            Container(
              height: 400,
              color: Colors.purple,
              child: const Text('我是容器7'),
            )
          ],
        ));
  }
}
